#include <iostream>
#include <ctype.h>
#include <string>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <set>
#include <vector>

using namespace std;

class Vocabulary
{
public:
    Vocabulary(const string& fileName);
    int size()  {   return words.size();   }
    set<string>& getWords()  {   return words;  }
private:
    set<string> words;
    static const unsigned MAX_WORDLEN = 10;
    static const unsigned MIN_WORDLEN = 4;
    bool validWord(string w);
};

bool Vocabulary::validWord(string w)
{
    return  w.size() >= MIN_WORDLEN && w.size() <= MAX_WORDLEN;
}


Vocabulary::Vocabulary(const string& fileName)
{
    ifstream inFile( fileName.c_str() );
    string word;

    while(!inFile.eof() &&  inFile >> word )
    {

        if(!validWord(word) )
            continue;

        transform(word.begin(),word.end(),word.begin(),::tolower);

        for (string::iterator it=word.begin(); it!= word.end();  )
        {
            if ( !isalpha(*it)  )
            {
                word.erase(it);
            }
            else
                ++it;
        }
        words.insert(word);
    }
    inFile.close();
}




int main()
{
//    string s[] = {"t1.txt", "t2.txt","t3.txt","t4.txt","t5.txt"};
//    vector<string> fn(s,s+5);
//
//
//
//    SimiCalculator calculator(fn.begin(), fn.end());
//
//    calculator.dispSimDegree();

}





